<template>
	<view>
		<!-- <image style="width: 100%;height: 200px;object-fit: cover;" mode="aspectFill" :src="topic.img"></image>
		<view class="padding" style="letter-spacing: 2px;font-size: 14px;">{{topic.intro}}</view> -->
		<view class="text-center padding-lr padding-top text-bold">{{topic.name}}</view>
		<view class="padding">
			<u-parse :loading="loading" :content="topic.intro" ></u-parse>
		</view>
		<view style="background-color: #F5F5F5;width: 100%;height: 10px;"></view>
		<view class="margin-top">
			<list-mall  :num='2' :datas='skus'></list-mall>
		</view>
	</view>
</template>

<script>
	import listMall from '@/components/devm/index/list-mall.vue'
	import uParse from "@/components/feng-parse/parse.vue";
	export default {
		components:{
			listMall,
			uParse
		},
		data() {
			return {
				topic:{},
				skus:[]
			}
		},onLoad(options) {
			var topicId = options.topicId;
			this.$get('mall/topic/commondetail',{topicId:topicId},'get',true).then((res)=>{
				this.topic = res.data;
				if(res.data.skus) {
					for (var k = 0; k < res.data.skus.length; k++) {
						var item = {
							id: res.data.skus[k].id,
							uri: res.data.skus[k].thumbnail,
							title: res.data.skus[k].name,
							specialprice: '￥' + res.data.skus[k].priceSale,
							originprice: res.data.skus[k].priceDel?'￥'+ res.data.skus[k].priceDel:''
						}
						this.skus.push(item)
					}
				}
			})
		}
	}
</script>

<style>
	page {
		background-color: #FFFFFF;
	}
</style>
